<!DOCTYPE html>
<html class="no-js" lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>疫情信息管理后台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" th:href="@{/assets/css/bootstrap.mincopy.css}">
    <link rel="stylesheet" th:href="@{/assets/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/assets/css/metisMenu.css}">
    <link rel="stylesheet" th:href="@{/assets/css/typography.css}">
    <link rel="stylesheet" th:href="@{/assets/css/styles.css}">

</head>

<body>
<div id="preloader">
    <div class="loader"></div>
</div>
<!-- preloader area end -->
<!-- page container area start -->

<div class="page-container">
    <!-- sidebar menu area start -->
    <div class="sidebar-menu">
        <div class="main-menu">
            <div class="menu-inner" style="width: 100%; height: 500px; overflow: hidden;">
                <nav>
                    <ul class="metismenu" id="menu">
                        <li>
                            <a href="javascript:void(0)" aria-expanded="true">
                                <span>疫情信息管理</span>
                            </a>
                            <ul class="collapse">
                                <li><a th:href="@{/admin/data}">数据管理</a></li>
                            </ul>
                            <ul class="collapse">
                                <li><a th:href="@{/admin/showtype}">风险数据</a></li>
                            </ul>
                        </li>
                        <li>
                            <a href="javascript:void(0)" aria-expanded="true">
                                <span>用户管理</span>
                            </a>
                            <ul class="collapse">
                                <li><a th:href="@{/userManger/toUserMessage}">用户信息</a></li>
                            </ul>
                        </li>
                        <li class="active">
                            <a href="javascript:void(0)" aria-expanded="true">
                                <span>管理员管理</span>
                            </a>
                            <ul class="collapse">
                                <li class="active"><a th:href="@{/adminManger/message}">当前账号</a></li>
                            </ul>
                            <ul class="collapse" th:if="${user.roles} eq ROLE_ROOT">
                                <li><a th:href="@{/root/toShow}">管理账号</a></li>
                            </ul>
                            <ul class="collapse" th:if="${user.roles} eq ROLE_ROOT">
                                <li><a th:href="@{/root/toAdd}">增加管理员</a></li>
                            </ul>
                        </li>
                        <li><a th:href="@{/admin/logout}"><span>退出登录</span></a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
    <!-- sidebar menu area end -->
    <!-- main content area start -->
    <div class="main-content">
        <div class="header-area">
            <div class="row align-items-center">
                <!-- nav button -->
                <div class="col-md-6 col-sm-8 clearfix">
                    <div class="nav-btn pull-left">
                        <span></span>
                        <span></span>
                        <span></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="main-content-inner">
            <form class="form-horizontal" th:action="@{/adminManger/update}" method="post">
                <input type="hidden" name="_method" value="put"/>
                <input type="hidden" id="id" name="id" th:field="${user.id}"/>
                <input type="hidden" id="active" name="active" th:field="${user.active}"/>
                <div class="form-group">
                    <label for="username" class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-4">
                        <input type="text"  class="form-control" id="username" name="username" th:field="${user.username}" readonly  unselectable="on"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="roles" class="col-sm-2 control-label">权限</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" id="roles" name="roles" th:field="${user.roles}" readonly  unselectable="on"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="password" class="col-sm-2 control-label">密码</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" id="password" name="password" th:field="${user.password}"/>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-info" onclick='subForm()'>更改</button>
                        &nbsp; &nbsp; &nbsp;
                        <input type="reset" value="重置" class="btn btn-info"/>
                    </div>

                </div>

            </form>
        </div>
    </div>

</div>

<script th:src="@{/assets/js/vendor/jquery-2.2.4.min.js}"></script>
<script th:src="@{/assets/js/bootstrap.min.js}"></script>
<script th:src="@{/assets/js/metisMenu.min.js}"></script>
<script>
function subForm(){
    const checkPassword = document.getElementById("password").value;
    if(checkPassword == ""){
        alert("请输入密码！")
    }
}
</script>
<script th:src="@{/assets/js/scripts.js}"></script>
</body>

</html>